Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get markdown working on browse pages #367

Merged
merged 4 commits into from
Feb 2, 2024
Merged

Get markdown working on browse pages #367

merged 4 commits into from
Feb 2, 2024

Conversation

summer-cook
Copy link
Contributor

@summer-cook summer-cook commented Feb 2, 2024

Story

Gets markdown working on the browse page. Homepage will still use snippets.

Related

Expected Behavior Before Changes

  • As a user, I would not see markdown in descriptions on the browse page that contain markdown

Expected Behavior After Changes

  • As a user, i will see markdown in descriptions on the browse page that contain markdown
  • As a user, I will see snippets on the featured service page, and descriptions on the browse/search page.

Screenshots / Video

Browse page will use description with markdown Video: https://share.zight.com/o0uOqZx2 image
Featured services will still use snippet image

Copy link

vercel bot commented Feb 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
webstore-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2024 10:01pm

Comment on lines 51 to 57
const truncateDescription = (desc = '', maxLength, isOpen) => {
if (desc.length <= maxLength || isOpen) return { truncated: desc, cutOffIndex: desc.length }
const lastSpaceIndex = desc.substring(0, maxLength).lastIndexOf(' ')
const ellipsis = isOpen ? '' : '...'
return { truncated: desc.slice(0, lastSpaceIndex) + ellipsis, cutOffIndex: lastSpaceIndex }
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this get moved to "utils/helpers.js"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes definitely, i just tried putting it back there and it worked! for some reason when i first tried that it didn't want to work for me.. but it was probably some other confounding error

pages/browse/index.js Outdated Show resolved Hide resolved
@alishaevn alishaevn merged commit 9d9e565 into main Feb 2, 2024
6 of 7 checks passed
@alishaevn alishaevn deleted the attempt-markdown branch February 8, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants